class Solution {
public:
    int minDeletion(vector<int>& a) {
        int n = a.size();
        int ans = 0;
        bool f = 0;
        for (int i = 0; i < n;) {
            if (f) {
                i++;
                f = !f;
                continue;
            }
            int j = i + 1;
            while (j < n && a[i] == a[j])j++;
            cout << "j==" << j << endl;
            ans += j - i - 1;
            i = j;
            f = !f;
        }
        cout << "ans==" << ans << endl;
        int x = n - ans;
        if (x & 1)ans++;
        return ans;
    }
};